package com.action.gulimall.gateway.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.HashMap;
import java.util.Map;

/**
 * @author sl shilun217@qq.com
 * @Deacription webflux实现controller 测试  作为api
 * @date 2021/07/18/16:38
 **/
@RestController
public class HelloFluxController {
    @GetMapping("/hello")
    public Mono<String> hello() {
        return Mono.just("Hello");
    }

    @GetMapping("/test")
    public Mono<Map> object() {
        Map emptyMap = new HashMap();
        emptyMap.put("username","shilun" );
        emptyMap.put("age","29" );
        emptyMap.put("email","shilun217@qq.com" );
        return Mono.just(emptyMap);
    }
}
